/***********************************************
 * Title:       StudentNoProvider.java
 * Description: StudentNoProvider.java
 * Author:      Niyuzhe
 * Create Date: 2010-2-9
 * CopyRight:   CopyRight(c)@2009
 * Company:     TJUSCS
 * Version:     1.0
 ***********************************************
 */
package edu.tju.admissions;

import edu.tju.runtimeConfig.TermService;

/**
 * @author Niyuzhe
 *
 */
public class StudentNoProvider
{
        
        private int count;
        private String specialityCode;
        
        public String provide( String term )
        {
                StringBuilder sb = new StringBuilder();
                String year = TermService.getInstance().getYear1(term);
                sb.append(year);
                sb.append(specialityCode);
                String countS = new Integer(count).toString();
                while( countS.length() < 3)
                {
                        countS = "0" + countS;
                }
                sb.append(countS);
                return sb.toString();
                
        }

        public void setSpecialityCode(String specialityCode)
        {
                this.specialityCode = specialityCode;
                this.count = 0;
        }
}
